home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / ISTALLIO.{6F < prev    next >
Text File  |  1999-09-17  |  4KB  |  135 lines

  1. /*****************************************************************************/
  2.  
  3. /*
  4.  *    istallion.h  -- stallion intelligent multiport serial driver.
  5.  *
  6.  *    Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
  7.  *    Copyright (C) 1994-1996  Greg Ungerer (gerg@stallion.oz.au).
  8.  *
  9.  *    This program is free software; you can redistribute it and/or modify
  10.  *    it under the terms of the GNU General Public License as published by
  11.  *    the Free Software Foundation; either version 2 of the License, or
  12.  *    (at your option) any later version.
  13.  *
  14.  *    This program is distributed in the hope that it will be useful,
  15.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *    GNU General Public License for more details.
  18.  *
  19.  *    You should have received a copy of the GNU General Public License
  20.  *    along with this program; if not, write to the Free Software
  21.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  */
  23.  
  24. /*****************************************************************************/
  25. #ifndef    _ISTALLION_H
  26. #define    _ISTALLION_H
  27. /*****************************************************************************/
  28.  
  29. /*
  30.  *    Define important driver constants here.
  31.  */
  32. #define    STL_MAXBRDS        4
  33. #define    STL_MAXPANELS        4
  34. #define    STL_MAXPORTS        64
  35. #define    STL_MAXCHANS        (STL_MAXPORTS + 1)
  36. #define    STL_MAXDEVS        (STL_MAXBRDS * STL_MAXPORTS)
  37.  
  38.  
  39. /*
  40.  *    Define a set of structures to hold all the board/panel/port info
  41.  *    for our ports. These will be dynamically allocated as required at
  42.  *    driver initialization time.
  43.  */
  44.  
  45. /*
  46.  *    Port and board structures to hold status info about each object.
  47.  *    The board structure contains pointers to structures for each port
  48.  *    connected to it. Panels are not distinguished here, since
  49.  *    communication with the slave board will always be on a per port
  50.  *    basis.
  51.  */
  52. typedef struct {
  53.     unsigned long        magic;
  54.     int            portnr;
  55.     int            panelnr;
  56.     int            brdnr;
  57.     unsigned long        state;
  58.     int            devnr;
  59.     int            flags;
  60.     int            baud_base;
  61.     int            custom_divisor;
  62.     int            close_delay;
  63.     int            closing_wait;
  64.     int            refcount;
  65.     int            openwaitcnt;
  66.     int            rc;
  67.     int            argsize;
  68.     void            *argp;
  69.     long            session;
  70.     long            pgrp;
  71.     unsigned int        rxmarkmsk;
  72.     struct tty_struct    *tty;
  73.     struct wait_queue    *open_wait;
  74.     struct wait_queue    *close_wait;
  75.     struct wait_queue    *raw_wait;
  76.     struct tq_struct    tqhangup;
  77.     struct termios        normaltermios;
  78.     struct termios        callouttermios;
  79.     asysigs_t        asig;
  80.     unsigned long        addr;
  81.     unsigned long        rxoffset;
  82.     unsigned long        txoffset;
  83.     unsigned long        sigs;
  84.     unsigned long        pflag;
  85.     unsigned int        rxsize;
  86.     unsigned int        txsize;
  87.     unsigned char        reqbit;
  88.     unsigned char        portidx;
  89.     unsigned char        portbit;
  90. } stliport_t;
  91.  
  92. /*
  93.  *    Use a structure of function pointers to do board level operations.
  94.  *    These include, enable/disable, paging shared memory, interrupting, etc.
  95.  */
  96. typedef struct stlibrd {
  97.     unsigned long    magic;
  98.     int        brdnr;
  99.     int        brdtype;
  100.     int        state;
  101.     int        nrpanels;
  102.     int        nrports;
  103.     int        nrdevs;
  104.     unsigned int    iobase;
  105.     int        iosize;
  106.     unsigned long    memaddr;
  107.     void        *membase;
  108.     int        memsize;
  109.     int        pagesize;
  110.     int        hostoffset;
  111.     int        slaveoffset;
  112.     int        bitsize;
  113.     int        enabval;
  114.     int        panels[STL_MAXPANELS];
  115.     int        panelids[STL_MAXPANELS];
  116.     void        (*init)(struct stlibrd *brdp);
  117.     void        (*enable)(struct stlibrd *brdp);
  118.     void        (*reenable)(struct stlibrd *brdp);
  119.     void        (*disable)(struct stlibrd *brdp);
  120.     char        *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
  121.     void        (*intr)(struct stlibrd *brdp);
  122.     void        (*reset)(struct stlibrd *brdp);
  123.     stliport_t    *ports[STL_MAXPORTS];
  124. } stlibrd_t;
  125.  
  126.  
  127. /*
  128.  *    Define MAGIC numbers used for above structures.
  129.  */
  130. #define    STLI_PORTMAGIC    0xe671c7a1
  131. #define    STLI_BOARDMAGIC    0x4bc6c825
  132.  
  133. /*****************************************************************************/
  134. #endif
  135.